//Page Object
import { request } from '../../request/index'
Page({
  data: {
    swiperlist: [],
    navigatorlist: [],
    floorlist: []//楼层数据
  },
  //页面开始加载就触发
  onLoad: function (options) {
    this.getnavigatorlist() //获取导航数据
    this.getswiperlist()//获取轮播图接口数据
    this.getfloorlist()//获取楼层数据

  },
  getnavigatorlist() {//获取导航数据
    request({ url: 'home/catitems' })
      .then(res => {
        this.setData({
          navigatorlist: res.data.message
        })
      })
  },
  getswiperlist() { //获取轮播图接口数据
    request({ url: 'home/swiperdata' })
      .then(res => {
        this.setData({
          swiperlist: res.data.message
        })

      })
  },
  getfloorlist() { //获取楼层接口数据
    request({ url: 'home/floordata' })
      .then(res => {
        this.setData({
          floorlist: res.data.message
        })

      })
  },
});
